<extend name="./Application/Admin/View/common/base.html" />
<block name="crumb">
    <span class="c-gray en">&gt;</span> 客户系统
    <span class="c-gray en">&gt;</span> 客户展示
</block>

<block name="content">
    <div class="tabBar cl m-b-10">
        <span class="current"><a href="{:U('Customer/index')}">客户列表</a></span>
    </div>

    <div class="text-c">
        <form class="Huiform" method="get" action="" >
            <input type="text" placeholder="客户名称/微信/手机" value="{$_GET['cName']}" class="input-text" style="width:150px" name="cName"/>
            <input type="text" placeholder="招商" value="{$_GET['aiName']}" class="input-text" style="width:150px" name="aiName"/>
            <input type="text" placeholder="微商" value="{$_GET['weName']}" class="input-text" style="width:150px" name="weName"/>
            <select name="to_agent" class="input-text search-select">
                <option value="">-- 请选择 --</option>
                <option value="1" <if condition="$_GET['to_agent'] eq 1">selected</if>>已转化</option>
            </select>
            <input type="hidden" name="m" value="admin"/>
            <input type="hidden" name="c" value="customer"/>
            <input type="hidden" name="a" value="index"/>
            <button type="submit" class="btn btn-success"><i class="Hui-iconfont"></i> 查询</button>
        </form>
    </div>

    <div class="mt-10">
        <table class="table table-border table-bordered table-bg table-sort table-hover">
            <thead>
            <tr><td colspan="11"><a href="{:U('Customer/add_custom')}" class="btn btn-primary">添加分配</a></td></tr>
            <tr class="text-c">
                <th><input type="checkbox" id="check_all"/></th>
                <th>客户名</th>
                <th>手机号</th>
                <th>微信</th>
                <th>客户地址</th>
                <th>关键词</th>
                <th>备注</th>
                <th>招商</th>
                <th>微商</th>
                <th>添加时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <form action="{:U('Customer/del_custom')}" method="post" id="batch_do">
                <volist name="customers" id="cus">
                    <tr class="text-c">
                        <td><input type="checkbox" class="check_list" name="c_id[]" value="{$cus['c_id']}"/></td>
                        <td>{$cus['c_name']}</td>
                        <td>{$cus['mobile']}</td>
                        <td>{$cus['wx_num']}</td>
                        <td>{$cus['c_area']}</td>
                        <td>{$cus['keyword']}</td>
                        <td>{$cus['remark']}</td>
                        <td>{$cus['name']}</td>
                        <td>{:GetManagerNameById($cus['wechat_manager'])}</td>
                        <td>{$cus['create_time']}</td>
                        <td>
                            <a></a>
                            <if condition="$cus['is_conversion'] eq 1">
                                <a class="label">已转化</a><else/>
                                <a class="label label-success" href="{:U('Customer/to_agent',array('id'=>$cus['c_id']))}">
                                    转化
                                </a>
                            </if>
                        </td>
                    </tr>
                </volist>
                <tr>
                    <td colspan="11">
                        <span class="label label-danger changeS" do="close">关闭</span>
                    </td>
                </tr>
            </form>
            </tbody>
        </table>
    </div>
    <div class="page" style="margin-top: 10px;">{$page}</div>
</block>
<block name="js">
    <script type="text/javascript">
        $(function(){
            $('.changeS').click(function ()
            {
                layer.confirm('您确认进行此操作吗，此操作无法恢复？', {
                    btn: ['确认','取消']
                }, function(){
                    $("#batch_do").submit();
                });
            });
        });
    </script>
</block>